package com.inventive.jmscache.server;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;

/**
 * @author Grant Little grant.little@inventivesoftware.com.au
 */
@Component
public class JmsCacheConnectionFactory implements ConnectionFactory {

    @Autowired
    protected JmsCacheServer jmsCacheServer;

    public Connection createConnection() throws JMSException {
        return new JmsCacheConnection(jmsCacheServer);
    }

    public Connection createConnection(String s, String s1) throws JMSException {
        return new JmsCacheConnection(jmsCacheServer);
    }
}
